1. Field of the Invention
The present invention relates generally to multimedia processors and particularly to MPEG decoders.
2. Related Art
Encoded digital video streams are used in a variety of applications that allow videos to be distributed on a variety of media. For example, movies can be stored on Digital Video Disc (DVD) for distribution or rental purposes. Similarly, digital video streams can be broadcast (DVB) to multiple subscribers on pay-per-view systems. Alternatively, digital video streams can be transmitted over a computer network, such as the Internet, and viewed on remote computers without the need for a dedicated DVD player or a DVB receiver.
Several encoding standards, such as MPEG, MPEG-2, MPEG-4, AVI, QuickTime, etc. have been developed for encoding and distribution of digital video streams. Different standards allow for varying degrees of functionality versus storage requirements. For example, MPEG-2 is primarily designed for encoding movies and other audio-visual works. Similarly, MPEG-4 is designed to handle video streams transmitted over low bandwidth communication channels.
Movies, on the other hand, are typically shot on optical film at rate of 24 frames/second by means of a photographic process, while audio is captured on a separate medium, with audio-video synchronization added to either recording medium. To store movies as digital video streams, therefore, each frame must be first captured in electronic format and then encoded according to a pre-selected encoding standard.
A system 100 for capturing and displaying an encoded digital video stream is illustrated in FIG. 1. First, a video camera 110 captures a scene 120 on film 130.
An encoder 140 then transfers the images stored on film 130 onto an encoded video stream 150 stored on an electronic storage medium. A decoder 160, in turn, decodes video stream 150 that is thus displayed on a screen of a display device 170. Decoder 160 can be either a dedicated device such as a DVD player or a general purpose device such as a computer. The display device 170 can be either a television set or a computer monitor.
Video streams encoded according to the MPEG-2 standard, for example, are often encoded for playback at a rate of 60 fields/second. A field 220 (FIG. 2) consists of only half the pixels of an image 210. By displaying successive fields 220 in rapid succession, the human eye perceives the entire image 210 as being displayed at once, while in reality only half image 210 is refreshed at any one time. Since only 24 frames where shot in the original movie for all 60 fields to be displayed during playback, each movie frame must be displayed an average of 2.5 times (60/24). This is typically, accomplished by displaying images 210 of successive frames 200 for a duration of 3 and 2 fields 220,in an alternating pattern, as shown in FIG. 2. This technique is typically referred to as xe2x80x9c3-2 pulldown.xe2x80x9d The MPEG-2 standard provides a repeat_first_field flag 310 on each frame 200 to indicate whether image 210 is to be displayed for 2 or 3 fields 220,as shown in FIG. 3. For example, in FIG. 3, when repeat_first_field flag 310 has a value xe2x80x9c0xe2x80x9d image 210 is displayed for two fields 220, while when repeat_first_field flag 310 has a value xe2x80x9c1xe2x80x9d image 210 is displayed for three fields 220.
In addition, a time stamp (not shown) is included in each frame 200 of the encoded video stream representing a desired playback time for each frame 200. The decoder, in turn, examines the time stamps of each frame 200 to determine whether the timing relationship among the frames in the encoded video stream is preserved during playback or whether playback timing must be adjusted to compensate for variations in the decoding/display process.
The MPEG-2 standard also provides a progressive_frame flag 410 (FIG. 4) that indicates whether each encoded image 210 represents an interlaced or a non-interlaced image. An interlaced image is one in which consecutive fields 220 are captured at successive points in time. Thus, to preserve correct timing, each field 220 in an interlaced image must be displayed at a different point in time. Interlaced images are typically displayed correctly on interlaced display devices (e.g., televisions sets, interlaced computer monitors, etc.). However, displaying interlaced images on non-interlaced (progressively-scanned) monitors is problematic. Progressive displays, in fact, display complete images 210 at each refresh interval. Therefore, each field 220 in an interlaced image must be xe2x80x9cfilledxe2x80x9d by interpolating values for the missing lines in each field 220. The interpolation process, however, results in a loss of image resolution and the introduction of artifacts which, in turn, degrade the overall image quality.
A non-interlaced image, by contrast, is an image 210 in which consecutive fields 220 are captured at the same time. Thus, playback of non-interlaced images on progressive monitors results in higher quality images because there are no missing lines.
Since the two fields in each movie frame are always shot at the same time, progressive_frame flag 410 should always be set to 1,as shown in FIG. 4. However, some encoders only set the progressive_frame flag to 1 when repeat_first_field flag 310 is also set to 1, as shown in FIG. 5. Movies encoded in such a fashion, therefore, are played back inconsistently on non-interlaced monitors, due to the alternation of display modes.
The present invention provides a method for improving playback consistency of an encoded video stream. The method of the present invention first determines whether a series of values of the progressive_frame flag of consecutive images of the encoded video stream are arranged in a predetermined pattern. If the values are arranged in the predetermined pattern, the image of at least one of the frames is displayed progressively regardless of the value of the progressive_frame flag for that frame. As a result, the video stream is played back as if the movie had been consistently encoded in the first place.